/* 
 * File:   global.h
 * Author: pehladik
 *
 * Created on 12 janvier 2012, 10:11
 */

#ifndef GLOBAL_H
#define	GLOBAL_H

#include "includes.h"

/* @descripteurs des tâches */
extern RT_TASK tServeur;
extern RT_TASK tconnect;
extern RT_TASK tmove;
extern RT_TASK tenvoyer;
extern RT_TASK tbatterie;
extern RT_TASK twatchdog;
extern RT_TASK timage;
extern RT_TASK tcalibrer;
extern RT_TASK tmission;

/* @descripteurs des mutex */
extern RT_MUTEX mutexEtat;
extern RT_MUTEX mutexMove;
extern RT_MUTEX mutexBatterie; 
extern RT_MUTEX mutexActionImage ;
extern RT_MUTEX mutexCompteurCommRobot ;
extern RT_MUTEX mutexServeur;
extern RT_MUTEX mutexMission;
extern RT_MUTEX mutexPosition; 
extern RT_MUTEX mutexArena ; 
extern RT_MUTEX mutexImage;

/* @descripteurs des sempahore */
extern RT_SEM semConnecterRobot;
extern RT_SEM semWatchDog;
extern RT_SEM semCalibrer;
extern RT_SEM semMission;
extern RT_SEM semImage ;
extern RT_SEM semBatterie ;

/* @descripteurs des files de messages */
extern RT_QUEUE queueMsgGUI;

/* @variables partagées */
extern int etatCommMoniteur;
extern int etatCommRobot;
extern int actionImage; 
extern int compteurEchecCommRobot ;
extern DServer *serveur;
extern DRobot *robot;
extern DMovement *move;
extern DBattery *batterie;
extern DCamera *camera ;
extern DArena *arena;
extern DPosition *position;
extern DMission *mission;

/* @constantes */
extern int MSG_QUEUE_SIZE;
extern int ACTION_STANDARD_ACQUISITION;
extern int MAX_TEST_COM ;

/* @priorités des tâches */
extern int PRIORITY_TSERVEUR;
extern int PRIORITY_TCONNECT;
extern int PRIORITY_TMOVE;
extern int PRIORITY_TENVOYER;
extern int PRIORITY_TBATTERIE;
extern int PRIORITY_WATCHDOG;
extern int PRIORITY_IMAGE;
extern int PRIORITY_TMISSION;

/* Période des tâches */
extern int PERIODE_IMAGE ;   
extern int PERIODE_DEPLACER;  
extern int PERIODE_BATTERIE;     
extern int PERIODE_WATCHDOG ;    

#endif	/* GLOBAL_H */

